package org.example.mutithread.future;

import org.example.pattern.strategy.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class App2 {

    private static final Logger LOGGER = LoggerFactory.getLogger(App2.class);

    public static void main(String[] args)
    {
        Strategy<String> strategy1 = new StrategyA("StrategyA-1","a", 1);
        Strategy<String> strategy5 = new StrategyA("StrategyA-2","b", 1);
        Strategy<String> strategy2 = new StrategyB("StrategyB-1",new TObj("A", 0));
        Strategy<String> strategy3 = new StrategyB("StrategyB-2",new TObj("B", 0));
        Strategy<String> strategy4 = new StrategyB("StrategyB-3",new TObj("C", 1));
        List<Strategy<String>> list = new ArrayList<>();
        list.add(strategy1);
        list.add(strategy2);
        list.add(strategy3);
        list.add(strategy4);
        list.add(strategy5);

        CompletableFutureUtil cu = new CompletableFutureUtil();
        Result<String> objectResult = cu.waitAll(list);

        LOGGER.info("result:{}", objectResult);

    }
}
